HTMLSample is an application illustrating how to use the new HTMLRenderingLib services found in Mac OS 9. HTMLRenderingLib is Apple's light-weight HTML rendering engine capable of displaying HTML files.
HTMLRendering related tasks illustrated include:
• how to draw HTML in a window using the HTMLRenderingLib,
• how to use the URL utilities provided by the HTMLRenderingLib,
• how to maintain a history of visited links and provide call backs to the HTMLRenderingLib for providing information about visited links,
• how to intercept URLs being displayed by the HTMLRenderingLib and re-direct them to other files. In this example, we use this facility to allow you to launch applications by clicking on URLs that refer to application files.
• Setting up the drawing environment correctly for drawing other objects in the same window when the window contains a HTML rendering object.
Other interesting techniques illustrated include:
• This is a Mac OS 9 package savy application. Techniques for opening HTML package documents are illustrated. These techniques include opening package documents when they are provided in open document Apple events and allowing the user to choose package documents in the Navigation Services window.
• Graying out a part of the window when it is inactive.
• Setting the standard window zoom state so clicking in its zoom box results in the window being zoomed to the best rectangle for viewing the HTML image being displayed.
You may incorporate this sample code into your applications without restriction, though the sample code has been provided "AS IS" and the responsibility for its operation is 100% yours. However, what you are not permitted to do is to redistribute the source as "DSC Sample Code" after having made changes. If you're going to re-distribute the source, we require that you make it clear in the source that the code was descended from Apple Sample Code, but that you've made changes.
Files:
':HTMLSample Help:' - a directory containing the HTML help files used by the application.
':HTMLSample Pages:' - a directory containing the default HTML pages used by the application.
':HTMLSample.prj Data:' - CodeWarrior project data
:obj: - compiled object files
AboutBox.c - routines for implementing the HTML about box.
AboutBox.h - prototypes for routines defined in AboutBox.c.
CIconButtons.c - routines implementing the color icon buttons displayed in the top of the HTML windows.
CIconButtons.h - prototypes for routines defined in CIconButtons.c.
History.c - routines for maintaining lists of visited links.
History.h - prototypes for routines defined in History.c.
HTMLSample - the compiled application.
HTMLSample.c - the main program and event dispatching code for the program.
HTMLSample.h - prototypes for routines defined in HTMLSample.c.
HTMLSample.prj - CodeWarrior project file.
HTMLSample.r - MPW Rez file for the program.
HTMLSample.rsrc - ResEdit resource file containing resources used in the program.
MakeFile - MPW make file for building the program.
'Re- C/F Registration Request' - Creator file type registration for the program.
ReadMe - see ReadMe.
RenderingWindow.c - Routines implementing the windows displayed by the program.
RenderingWindow.h - prototypes for routines defined in RenderingWindow.c.
SampleUtils.c - utility routines set aside to simplify the example.
SampleUtils.h - prototypes for routines defined in SampleUtils.c.